from core.basehandler import BaseHandler
from core.room import Room
from core.action import Action

class Introduction(Room):
    
    def __init__(self, room_id):
        Room.__init__(self, room_id)    # do basic initialization for every room
        # build list of actions
        self.add_action(ToStartPoint)
    
    # return description of room.
    def get_description(self):
        return '''
        As the First Emperor after China's unification, Emperor Qin Shi owned countless treasures and most of 
        them were buried with him after his death. The main tomb containing the emperor has yet to be opened. 
        It is said that the tomb includes replicas of palaces and scenic towers, 100 rivers made with mercury, 
        representations of "the heavenly bodies", and crossbows rigged to shoot anyone who tried to break in. 
        The potion of immorality is in the deepest place of the underground labyrinth. Secrets were maintained, 
        as most of the workers who built the tomb were killed...
        '''
    # return image of room
    def get_image(self):
        return 'cover.jpg'
         

class IntroductionHandler(BaseHandler):
    
    # return class to use to create a new instance of this room
    def get_room_class(self):
        return Introduction

# define actions for this room

class ToStartPoint(Action):
    def __init__(self):
        Action.__init__(self, "tostartpoint")    # do basic initialization for every action
           
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Start Game"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return "startingpoint"
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"